package com.sky.mapper;


import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;


@Mapper
public interface UserMapper {
    /**
     * 根据openId查询用户
     * @param openId
     * @return
     */
    @Select("select * from user where openid = #{openId}")
    User getByOpenId(String openId);


    void insert(User user);

    /**
     * 根据id查询数据
     * @param user
     * @return
     */
    @Select("select * from user where id = #{id}")
    User getById(User user);

    /**
     * 更新用户信息
     * @param user
     */
    void update(User user);

    Integer userCount(HashMap map);
}
